<?php
include './dir1/dir11/ClassObj.php';
include './dir1/dir11/ClassObj2.php';
// require './dir1/dir11/ClassObj.php'; //这样也可以
// use dir1\dir11\ClassObj;

echo "<p>====================== 直接访问静态变量 ======================</p>";
echo \dir1\dir11\ClassObj::$name;

echo "<p>====================== 直接访问静态方法 ======================</p>";
\dir1\dir11\ClassObj::func1();

echo "<p>====================== 访问普通方法 ======================</p>";
$Obj = new \dir1\dir11\ClassObj();
// $Obj = new dir1\dir11\ClassObj();//这里不加最前面的反斜杠也可以，因为当前命名空间是空，拼接一个空和没有拼接都一样
// $Obj = new ClassObj();//如果上面use了，这里就可以这样写
$Obj -> func2();

echo "<hr>";
echo "<p>====================== 访问ClassObj2的普通方法 ======================</p>";
$Obj2 = new \obj2\ClassObj2();
$Obj2 -> func2();


//get_declared_classes — 返回由已定义类的名字所组成的数组
echo "<hr>";
echo "<pre>";
print_r(get_declared_classes());
echo "</pre>";
